{% extends "base.phtml" %}

{% block content %}
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title"></h3>
    </div>

    <div class="box-body">
        <form class="form-horizontal" action="save" data-redirect="index">
            <div class="form-group">
                <label class="col-sm-2 control-label">配置说明</label>
                <div class="col-sm-10">
                    <textarea name="attrdesc" rows="3" style="width:100%;">{{data?data.attrdesc:''}}</textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">奖励类型</label>
                <div class="col-sm-5">
                    <select class="form-control" name="type">
                        <option value="trading_" {%if data and data.type=='trading_'%}selected{%endif%}>成单奖励</option>
                        <option value="view_" {%if data and data.type=='view_'%}selected{%endif%}>浏览奖励</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">奖励条件</label>
                <div class="col-sm-3">
                    <input class="form-control" type="number" name="from" value="{{data?data.from:''}}">
                </div>
                <div class="col-sm-1">-------</div>
                <div class="col-sm-3">
                    <input class="form-control" type="number" name="to" value="{{data?data.to:''}}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">奖励天数</label>
                <div class="col-sm-10">
                    <input class="form-control" type="number" name="attrval"  value="{{data?data.attrval:''}}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">是否启用</label>
                <div class="col-sm-10">
                    <label class="control-label" style="margin-right: 5px;">
                        <input type="checkbox" class="minimal" name="enable" value="1" {%if (data and data.enable) or !data%}checked{%endif%}>
                    </label>
                </div>
            </div>

            <div class="box-footer text-center">
                <input type="hidden" value="{{id}}" name="id"/>
                <input type="hidden" value="1" name="attrtype" />
                <button class="btn btn-info submit">保存</button>
            </div>
        </form>
    </div>
</div>
{%endblock%}